package L619;

import util.TreeNode;

/**
 * @program: javase
 * @description: 翻转一棵二叉树。
 * @author: luolidong
 * @create: 2021-06-19 16:17
 * @version: 1.0
 */
public class Demo2 {
    public TreeNode invertTree(TreeNode root) {
        if(root==null) return null;
        TreeNode left=root.left;
        root.left=root.right;
        root.right=left;
        invertTree(root.left);
        invertTree(root.right);
        return root;



    }
}
